package pl.donajski.magisterka;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.NoSuchElementException;
import java.util.Scanner;

public abstract class FileLoader implements ILoader {

	public FileLoader(String fileName) throws FileNotFoundException {
		this.mScanner = new Scanner(new FileInputStream(fileName));
	}
	
	/**
	 * @return
	 * @see java.util.Scanner#hasNext()
	 */
	public boolean hasNext() throws IllegalStateException {
		return mScanner.hasNext();
	}

	/**
	 * @return
	 * @see java.util.Scanner#next()
	 */
	public String next() throws IllegalStateException, NoSuchElementException {
		return mScanner.next();
	}

	/**
	 * @return
	 * @see java.util.Scanner#hasNextLine()
	 */
	public boolean hasNextLine() throws IllegalStateException{
		return mScanner.hasNextLine();
	}

	/**
	 * @return
	 * @see java.util.Scanner#nextLine()
	 */
	public String nextLine() throws IllegalStateException, NoSuchElementException {
		return mScanner.nextLine();
	}

	/**
	 * 
	 * @see java.util.Scanner#close()
	 */
	public void close() {
		mScanner.close();
	}





	private Scanner mScanner;
}
